Telegram Group & Telegram Channel
Всем привет, подскажите как 2 роутера использовать во Vue:

import router from './routes';
import adminRouter from './admin/routes';

createApp(App)
.use(router)
.use(adminRouter);


admin/router/index.js:
import { createRouter, createWebHistory } from 'vue-router';
import AdminLayout from "../layouts/AdminLayout.vue";
import Orders from '../pages/Orders.vue';

const routes = [
{ path: '/', component: AdminLayout, children: [
{ path: '/orders', name: 'AdminOrders', component: Orders, meta: {title: 'Заявки'} },
]
},
];

const adminRouter = createRouter({
history: createWebHistory('/admin'),
routes,
});

export default adminRouter;


routes/index.js:
import { createRouter, createWebHistory } from 'vue-router';
import AppLayout from "../layouts/AppLayout.vue";
import Main from '../pages/Main.vue';

const routes = [
{ path: '/', component: AppLayout, children: [
{ path: '/', name: 'Main', component: Main, meta: {title: 'Главная'} },
]
},
];

export default router;


Так вообще можно делать?? В консоли всякие ошибки



tg-me.com/vuejs_ru/1610778
Create:
Last Update:

Всем привет, подскажите как 2 роутера использовать во Vue:

import router from './routes';
import adminRouter from './admin/routes';

createApp(App)
.use(router)
.use(adminRouter);


admin/router/index.js:
import { createRouter, createWebHistory } from 'vue-router';
import AdminLayout from "../layouts/AdminLayout.vue";
import Orders from '../pages/Orders.vue';

const routes = [
{ path: '/', component: AdminLayout, children: [
{ path: '/orders', name: 'AdminOrders', component: Orders, meta: {title: 'Заявки'} },
]
},
];

const adminRouter = createRouter({
history: createWebHistory('/admin'),
routes,
});

export default adminRouter;


routes/index.js:
import { createRouter, createWebHistory } from 'vue-router';
import AppLayout from "../layouts/AppLayout.vue";
import Main from '../pages/Main.vue';

const routes = [
{ path: '/', component: AppLayout, children: [
{ path: '/', name: 'Main', component: Main, meta: {title: 'Главная'} },
]
},
];

export default router;


Так вообще можно делать?? В консоли всякие ошибки

BY Александр www in Vue.js — русскоговорящее сообщество


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/vuejs_ru/1610778

View MORE
Open in Telegram


Vue js — русскоговорящее сообщество Telegram | DID YOU KNOW?

Date: |

Launched in 2013, Telegram allows users to broadcast messages to a following via “channels”, or create public and private groups that are simple for others to access. Users can also send and receive large data files, including text and zip files, directly via the app.The platform said it has more than 500m active users, and topped 1bn downloads in August, according to data from SensorTower.

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

Vue js — русскоговорящее сообщество from sg


Telegram Александр www in Vue.js — русскоговорящее сообщество
FROM USA